import request from '@/utils/request'
export function getPropInputTypes () {
  return request({
    url: '/api/Field/FieldManage/GetPropInputTypes',
    method: 'get',
  })
}

export function getFields () {
  return request({
    url: '/api/Field/FieldManage/GetFields',
    method: 'get',
  })
}

export function getFieldProps (params) {
  return request({
    url: '/api/Field/FieldManage/GetFieldProps',
    method: 'get',
    params
  })
}

export function addField (data) {
  return request({
    url: '/api/Field/FieldManage/AddField',
    method: 'post',
    data,
  })
}

export function deleteField (fieldId) {
  return request({
    url: '/api/Field/FieldManage/DeleteField',
    method: 'get',
    params: {
      fieldId
    },
  })
}

export function addFieldProp (data) {
  return request({
    url: '/api/Field/FieldManage/AddFieldProp',
    method: 'post',
    data,
  })
}

export function saveFieldProp (data) {
  return request({
    url: '/api/Field/FieldManage/SaveFieldProp',
    method: 'post',
    data,
  })
}

export function deleteFieldProp (propId) {
  return request({
    url: '/api/Field/FieldManage/DeleteFieldProp',
    method: 'get',
    params: {
      propId
    },
  })
}